
local kaoxun = fk.CreateSkill{
  name = "wk_heg__kaoxun",
   tags = { Skill.MainPlace },
}

Fk:loadTranslationTable{
  ["wk_heg__kaoxun"] = "拷讯",
  [":wk_heg__kaoxun"] = "主将技，此武将牌上单独的阴阳鱼个数-1；出牌阶段，你可令一名已横置的其他角色重置并弃置其一张手牌，若此牌为伤害类牌，你对其发起强制执行的“军令”。",
  ["#wk_heg__kaoxun_pro"] = "拷讯：你可以展示一名已横置其他角色的一张牌，若为伤害类牌，你对其造成1点伤害",
 
  ["$wk_heg__kaoxun1"] = "严刑峻法，以破奸诡之胆。",
  ["$wk_heg__kaoxun2"] = "你招还是不招？",
}

local H = require "packages.ol_hegemony.util"

kaoxun:addEffect("active", {
  anim_type = "offensive",
  prompt = "#wk_heg__kaoxun_pro",
  can_use = Util.TrueFunc,
  card_num = 0,
  card_filter = Util.FalseFunc,
  target_num = 1,
  target_filter = function(self, player, to_select, selected, selected_cards)
    return #selected == 0 and to_select.chained and to_select ~= player
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    target:setChainState(false)
    if not target.dead and not target:isKongcheng() then
      local cards = room:askToChooseCard(player, {
        target = target,
        flag = "h",
        skill_name = kaoxun.name,
      })
      local card = Fk:getCardById(cards)
      room:throwCard(cards, kaoxun.name, target, player)
      if card.is_damage_card and not target.dead and not player.dead then
        H.askCommandTo(player, target, kaoxun.name, true)
      end
    end
  end,
})

return kaoxun